package com.tc.nio.c4;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;

/**
 * @Auther: tianchao
 * @Date: 2022/2/5 23:30
 * @Description:
 */
public class Client {
    public static void main(String[] args) throws IOException {
        SocketChannel socketChannelClient = SocketChannel.open();
        socketChannelClient.connect(new InetSocketAddress("localhost",8080));
        socketChannelClient.write(Charset.defaultCharset().encode("hello\nworld\nhello111111111111111111111111111111a\n"));
        System.out.println("waiting.................");
    }
}
